home *** CD-ROM | disk | FTP | other *** search
Text File | 1985-08-11 | 12.0 KB | 443 lines | [TEXT/Anon] |
-
- MAC.68K
-
-
-
-
-
-
- ENDD
- ENDD
- ENDD
-
-
-
-
- PURPOSE To terminate a DUP block.
-
-
-
-
- FORMAT ENDD
-
-
- dupname ENDD
-
-
-
-
- DESCRIPTION A unnamed ENDD will always terminate the current
-
-
- DUP or ECHO block even if the block has a dupname. A
-
-
- named ENDD terminates the current block if its dupname
-
-
- matches the block name. A named ENDD will be ignored
-
-
- if its name does not match the active dupname.
-
-
-
-
-
-
-
-
-
- ENDM
- ENDM
- ENDM
-
-
-
-
- PURPOSE To end a macro definition.
-
-
-
-
- FORMAT ENDM
-
-
- macroname ENDM
-
-
-
-
- DESCRIPTION ENDM terminates a macro definition. Accidently
-
-
- ommitting an ENDM results in the apparent loss of code
-
-
- since the following lines are placed into the macro
-
-
- definition and are not assembled.
-
-
-
- A named ENDM does not terminate a macro defintion
-
-
- unless the macroname matches the MACRO or MACROL being
-
-
- defined. This allows macro definitions to be placed
-
-
- inside a macro definition. A macro nested in this
-
-
- manner will not be defined until the outer level macro
-
-
- is called.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MAC.68K -30-
-
-
-
- MAC.68K
-
-
-
-
-
- ENTRY
- ENTRY
- ENTRY
-
-
-
-
-
- PURPOSE To specify relative symbolic entry points for a module
-
-
- assembly.
-
-
-
-
-
- FORMAT ENTRY symbol,symbol,...symbol
-
-
-
-
-
- DESCRIPTION ENTRY is used with MODULE to provide a list of
-
-
- symbol names and offset values that are placed in the
-
-
- module object file. Any symbol name defined in the
-
-
- module may be used. Since modules are assigned an
-
-
- origin address of $0, the symbol values represent a
-
-
- relative offset from the start ($0) of the module.
-
-
-
- When the object module is later used in another
-
-
- assembly, these $0 relative values will be biased by
-
-
- the current location address in the calling assembly,
-
-
- and the symbol with its new value will be entered into
-
-
- the symbol table.
-
-
-
-
-
- EXAMPLE ENTRY READCH,WRITECH
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -31- MAC.68K
-
-
-
- MAC.68K
-
-
-
-
-
- EQU or =
- EQU or =
- EQU or =
-
-
-
-
-
- PURPOSE To define a symbol.
-
-
-
-
-
- FORMAT symbol EQU expression
-
-
- symbol = expression
-
-
-
-
-
- DESCRIPTION EQU assigns a permanent value to the symbol name in
-
-
- the location field. Any symbols used in the expression
-
-
- must have been previously defined. If an error is
-
-
- detected the symbol remains undefined, or retains its
-
-
- current value if a redefinition is attempted.
-
-
-
- EQU may not be used on a symbol previously
-
-
- established as redefinable with a SET, MAX, MIN, or
-
-
- STRCNT. Also any symbol previously established as
-
-
- permanent may not be redefined with EQU, SET, MAX,
-
-
- MIN, or STRCNT.
-
-
-
-
-
- EXAMPLES RESET EQU 0
-
-
- SAMPLE2 EQU SAMPLE1+1
-
-
- reset = 0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MAC.68K -32-
-
-
-
- MAC.68K
-
-
-
-
-
- ERRxx
- ERRxx
- ERRxx
-
-
-
-
- PURPOSE To force a source line fatal error flag type P.
-
-
-
-
- FORMAT ERR
-
-
- ERRxx expression
-
-
-
- xx = EQ NE GE GT LE LT
-
-
-
-
- DESCRIPTION ERRxx can be used to detect and call attention to
-
-
- program errors at assembly time. For example, a macro
-
-
- expansion might do range checks on parameters and
-
-
- force an assembly error if the macro was called with
-
-
- an invalid parameter. ERRxx checks are done during
-
-
- pass 2 and may contain forward symbol references.
-
-
-
- ERR unconditionally forces a P type source line
-
-
- error.
-
-
-
- ERRxx compares the value of the expression in the
-
-
- operation field and produces an error if condition xx
-
-
- is true. For example, ERREQ produces an error when the
-
-
- expression value is zero.
-
-
-
-
- EXAMPLES ERREQ PAGESIZE
-
-
- ERRGT P1-5
-
-
-
- IFS EQ,$P1$$,1 CHECK FOR A NULL PARAMETER
-
-
- ERR P1 IS A REQUIRED PARAMETER
-
-
-
-
-
-
-
-
- EVEN
- EVEN
- EVEN
-
-
-
-
- PURPOSE To force the location counter to an even boundary.
-
-
-
-
- FORMAT EVEN
-
-
-
-
- DESCRIPTION If the current location counter is at an odd
-
-
- address, EVEN adds one to its value to set it to an
-
-
- even address boundary. Note that all CPU
-
-
- instructions, word and long word data operations, and
-
-
- section pseudo ops automatically adjust to even word
-
-
- boundaries.
-
-
-
-
-
-
- -33- MAC.68K
-
-
-
- MAC.68K
-
-
-
-
-
- GLOBL
- GLOBL
- GLOBL
-
-
-
-
-
- PURPOSE To declare external symbol names.
-
-
-
-
-
- FORMAT GLOBL symbol
-
-
- GLOBL symbol,symbol,...
-
-
-
-
-
- DESCRIPTION GLOBL declares symbols to be external. If the
-
-
- symbol is defined in the current assembly, the symbol
-
-
- is written to the .O file as a defined external symbol
-
-
- and becomes available for use in other routines at
-
-
- LO68 link time. If the symbol is undefined in the
-
-
- current assembly, it is written to the .O file as an
-
-
- undefined external symbol and LO68 searches the other
-
-
- load modules to locate the address of the symbol.
-
-
-
- The -U invocation option sets all undefined
-
-
- symbols as external references. This is useful for C
-
-
- programs which make many references to library
-
-
- routines, but it can mask legitimate undefined symbol
-
-
- names when used with assembler source files. One can
-
-
- use explicit GLOBL statements and avoid the -U
-
-
- option.
-
-
-
-
-
- EXAMPLE GLOBL DUMPMEM,DUMPREG
-
-
- GLOBL CINCO
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MAC.68K -34-
-
-
-
- MAC.68K
-
-
-
-
-
- HERE
- HERE
- HERE
-
-
-
-
-
- PURPOSE To assemble a block of code saved by previous
-
-
- DEFER(s).
-
-
-
-
-
- FORMAT HERE
-
-
- defname HERE
-
-
-
-
-
- DESCRIPTION HERE inserts all source lines saved by prior
-
-
- similiarly named DEFERs. A HERE with no source lines
-
-
- in its DEFER buffer has no effect on the assembly.
-
-
-
-
-
- EXAMPLE
-
-
-
- TABLE MACRO P1,P2,P3 CHAR TABLE 'A',1,PROCA
-
-
- DC.B P1 TABLE 'B',2,PROCB
-
-
- T2 DEFER TABLE 'C',3,PROCC
-
-
- DC P2 VALUE DS 0
-
-
- DEFER T2 HERE
-
-
- T3 DEFER PADDR DS.L 0
-
-
- DC.L P3 T3 HERE
-
-
- DEFER
-
-
- ENDM
-
-
- generates
-
-
-
- CHAR DC.B 'A'
-
-
- DC.B 'B'
-
-
- DC.B 'C'
-
-
- VALUE DS 0
-
-
- DC 1
-
-
- DC 2
-
-
- DC 3
-
-
- PADDR DS.L 0
-
-
- DC.L PROCA
-
-
- DC.L PROCB
-
-
- DC.L PROCC
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -35- MAC.68K
-
-
-
- MAC.68K
-
-
-
-
-
- IDENT
- IDENT
- IDENT
-
-
-
-
-
- PURPOSE To identify start of program text, program name, and
-
-
- program absolute origin.
-
-
-
-
-
- FORMAT IDENT
-
-
- IDENT name
-
-
- IDENT name,origin
-
-
- IDENT name,origin,data,bss
-
-
-
-
-
- DESCRIPTION An IDENT is an optional first card in a MAC.68K
-
-
- input source file. If the name field is present, it
-
-
- identifies the program name and is used as the base
-
-
- file name for the object file. Else the source file
-
-
- name is used as the base file name for the object
-
-
- file.
-
-
-
- In the Macintosh environment the default (and for
-
-
- now the only practical) load address is 0. There is no
-
-
- fixed load address for the Mac, and every assembly
-
-
- language program should be programmed using relative
-
-
- addressing. The only absolute references should be to
-
-
- the operating systems fixed location variables and
-
-
- constants in low memory ($16A - $B00). The following
-
-
- paragraphs describe features available for CPM/68K
-
-
- usage.
-
-
-
- MAC.68K uses its own load address as the default
-
-
- absolute load origin address for a .68K object file.
-
-
- For an absolute load address higher than $500, the
-
-
- optional origin field may be used to specify the
-
-
- desired address. Once selected, no code may be
-
-
- origined lower than the load address.
-
-
-
- When generating .68K object files, MAC.68K by
-
-
- default assigns the data and bss segments to be
-
-
- contiguous with the program segment. To specifically
-
-
- assign origins to these segments, the data and bss
-
-
- fields may be used on the IDENT card. These two
-
-
- fields may contain forward symbol references.
-
-
-
-
-
- EXAMPLES IDENT CONVERT
-
-
- IDENT CONVERT,$4000
-
-
- IDENT TEST,$1000,$4000,$8000
-
-
-
-
-
-
-
-
- MAC.68K -36-
-
-
- $4000
-
-
- IDENT TEST,$1000,$4000,$8000
-
-
-
-
-
-
-
-
- MAC.68K